<%--
  Created by IntelliJ IDEA.
  User: 神🍭仙💤
  Date: 2019/6/4
  Time: 9:44
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="false" %>
<html>
<head>
    <title>离退休</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}\common\layui\css\layui.css">
</head>
<%--样式
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="format-detection" content="telephone=no">
<link rel="stylesheet" type="text/css" href="/common/layui/css/layui.css" media="all">
<link rel="stylesheet" type="text/css" href="/common/bootstrap/css/bootstrap.css" media="all">
<link rel="stylesheet" type="text/css" href="/common/global.css" media="all">
<link rel="stylesheet" type="text/css" href="/css/personal.css" media="all">
--%>
<%--<style>
    input{width: 200px;height: 40px;border-radius:2px;}
    .cit{background-color: #4CAF50;border: none;color: white;padding: 10px 20px;text-align: center;text-decoration: none;display: inline-block;font-size: 10px;margin: 4px 2px;cursor: pointer;}
</style>--%>

<script src="${pageContext.request.contextPath}\js\jquery2.js"></script>
<script src="${pageContext.request.contextPath}\common\layui\layui.js"></script>
<script src="" charset="utf-8"></script>
<script>
    function trShwo() {
        /*点击tr*/
        $("tr:gt(0)").on({
            "click": function () {
                $.ajax({
                    type: "POST",
                    url: "XiaoJianEmpControllerLtx/trclickFunction",
                    dataType: "JSON",
                    data: {
                        empid: $(this).children().eq(1).text()
                    },
                    success: function (msg) {
                        alert("-------------------------个人信息-------------------------\n" + "序号：" + msg[0].id + "\n人员编号：" + msg[0].empid + "\n人员姓名：" + msg[0].empname + "\n性别：" + msg[0].sex + "\n学历：" + msg[0].education + "\n所在职位：" + msg[0].name + "\n所在部门：" + msg[0].dname + "\n身份证号：" + msg[0].idcard + "\n出生日期：" + msg[0].birthday + "\n办公电话：" + msg[0].officephone)
                    },
                    error: function () {
                        alert("error");
                    }
                });
                console.log($(this).children().eq(1).text())
            }
        })
    }

    function selectShow() {
        console.log("from=" + $("#formdata").serialize());
        /*进页面查*/
        $.ajax({
            type: "POST",
            url: "XiaoJianEmpControllerLtx/selectEmpJobDuctEmpstatus",
            dataType: "JSON",
            data: $("#formdata").serialize(),
            /*async: true,*/
            success: function (msg) {
                $("tbody").empty()
                if (msg.length == 0) {
                    alert("没有查找到此人!")
                } else {
                    $.each(msg, function (index, data) {
                        $("tbody").append("<tr><td>" + data.id + "</td><td>" + data.empid + "</td><td>" + data.empname + "</td><td>" + data.dname + "</td><td>" + data.name + "</td><td>" + data.sex + "</td><td>" + data.idcard + "</td><td>" + data.birthday + "</td><td>" + data.education + "</td><td>" + data.zname + "</td><td>" + data.officephone + "</td><td><a href='XiaoJianEmpControllerLtx/jspShow?empid=" + data.empid + "' class='layui-btn layui-btn-lg' >离退休</a></td>")
                    })
                }
                //给tr绑定点击事件
                trShwo();
            },
            error: function () {
                alert("error")
            }
        });
    }

    $(function () {
        //进页面就去查询
        selectShow()
        //给查询按钮绑定点击事件
        $("#btnsubmit").on({
            "click": function () {
                //点击查询按钮条件查询
                selectShow();
            }
        })
        //分页查询
        $(".layui-btn.layui-btn-small.layui-btn-primary").on({
            "click": function () {
                $("[name=state]").val($(this).val());
                $("[name=reverse]").val($("[name=reversex]").val())
                selectShow();
            }
        })

    })


</script>
<body>
<section class="layui-larry-box">
    <div align="center" style="font-size: 2em;height: 60px">离退休</div>
    <div class="larry-personal">
        <div class="layui-tab">
            <blockquote class="layui-elem-quote news_search">

                <div class="layui-inline">

                    <form class="layui-form" id="formdata">
                        <%--分页用的用于传值--%>
                        <input type="text" hidden name="i" value="1">
                        <%--按钮值传入input--%>
                        <input type="text" hidden name="state" value="">
                        <%--跳转input框--%>
                        <input type="text" hidden name="reverse" value="">
                        <script src="js/input.js"></script>
                        <div class="layui-inline">
                            <div class="layui-inline">
                                <label class="layui-form-label">姓名</label>
                                <div class="layui-input-inline">
                                    <input name="empname" placeholder="请输入姓名可模糊匹配哦！" class="layui-input search_input"
                                           type="text">
                                </div>
                            </div>

                            <div class="layui-inline">
                                <label class="layui-form-label">性别</label>
                                <div class="layui-input-inline">
                                    <select name="sex" id="selsex" class="newsLook" style="width: 10%;">
                                        <option value="">--请选择--</option>
                                        <option value="">--无--</option>
                                        <option value="男">男</option>
                                        <option value="女">女</option>
                                    </select>
                                </div>
                            </div>

                            <div class="layui-inline">
                                <label class="layui-form-label">学历</label>
                                <div class="layui-input-inline">
                                    <select name="education" class="newsLook" lay-filter="browseLook">
                                        <option value="">--请选择--</option>
                                        <option value="">--无--</option>
                                        <option value="初中">初中</option>
                                        <option value="高中">高中</option>
                                        <option value="大学">大学</option>
                                        <option value="高等">高等</option>
                                    </select>
                                </div>
                            </div>

                            <br>
                            <br>

                            <div class="layui-inline">
                                <label class="layui-form-label">部门</label>
                                <div class="layui-input-inline">
                                    <select name="dname" id="sel1" class="newsLook">
                                        <option value="">--请选择--</option>
                                        <option value="">--无--</option>
                                    </select>
                                </div>
                            </div>

                            <div class="layui-inline">
                                <label class="layui-form-label">职位</label>
                                <div class="layui-input-inline">
                                    <select name="zname" id="sel2" class="newsLook" lay-filter="browseLook">
                                        <option value="">--请选择--</option>
                                        <option value="">--无--</option>
                                    </select>
                                </div>

                            </div>

                            <div class="layui-inline">
                                <label class="layui-form-label">职称</label>
                                <div class="layui-input-inline">
                                    <select name="name" id="sel3" class="newsLook" lay-filter="browseLook">
                                        <option value="">--请选择--</option>
                                        <option value="">--无--</option>
                                    </select>
                                </div>
                            </div>
                    </form>

                    <%--高级查询--%>
                    <div class="layui-inline">
                        <input id="btnsubmit" class="layui-btn" value="查询"/>
                    </div>

                    <script type="text/javascript"
                            src="${pageContext.request.contextPath}\common/layui/layui.js"></script>
                    <script type="text/javascript" src="${pageContext.request.contextPath}\js/newsadd.js"></script>

                </div>
            </blockquote>

            <%--数据表--%>
            <table class="layui-table">
                <thead>
                <tr>
                    <th>序号</th>
                    <th>人员编号</th>
                    <th>人员姓名</th>
                    <th>所在部门</th>
                    <th>所在职位</th>
                    <th>性别</th>
                    <th>身份证号</th>
                    <th>出生日期</th>
                    <th>学历</th>
                    <th>职称</th>
                    <th>办公电话</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>

                </tbody>
            </table>

            <%--分页--%>
            <div align="center">
                <div class="layui-btn-group">
                    <button value="首页" class="layui-btn layui-btn-small layui-btn-primary"><i class="layui-icon">首页</i>
                    </button>
                    <button value="上一页" class="layui-btn layui-btn-small layui-btn-primary"><i class="layui-icon">&#xe603;</i>
                    </button>
                    <button value="下一页" class="layui-btn layui-btn-small layui-btn-primary"><i class="layui-icon">&#xe602;</i>
                    </button>
                    <button value="尾页" class="layui-btn layui-btn-small layui-btn-primary"><i class="layui-icon">尾页</i>
                    </button>
                    输入页数:<input type="text" name="reversex" style="width: 45px"/>
                    <button value="跳转" class="layui-btn layui-btn-small layui-btn-primary"><i class="layui-icon">跳转</i>
                    </button>
                </div>
            </div>

            <br><br><br><br><br><br><br><br><br><br><br><br><br><br>
        </div>
    </div>

</section>
</body>
</html>